﻿@model Atacadao.Web.ModelView.TestePesquisa

@{
    ViewBag.Title = "Lista";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Lista</h2>


@using (Ajax.BeginForm("Pesquisa", new AjaxOptions() { HttpMethod = "Post", UpdateTargetId = "dvListTeste", InsertionMode = InsertionMode.Replace }))
{
    <fieldset>
        <legend>Teste</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nome)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nome)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Ordem)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Ordem)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CodigoTipoTeste)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CodigoTipoTeste)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Campo1)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Campo1)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Campo2)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Campo2)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Data)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Data)
        </div>

        <p>
            <input type="submit" value="Pesquisar" />
        </p>
    </fieldset>


<div id="dvListTeste">
@{
    this.ViewData.Add("CtrGrid", "dvListTeste");
}
@Html.Partial("ListaParcial", (IEnumerable<Atacadao.DB.Teste>)ViewBag.Lista,this.ViewData)
</div>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
